import { Navigate  } from 'react-router-dom'

const RouterAuth = ({ children }) => {
  const token = localStorage.getItem('react-app-token')
    if(!token) {
        return <Navigate to="/login" replace />
    }
    return children
}

export default RouterAuth
